# -*- coding:utf-8 -*-
# 两个栈实现一个队列


class Solution:
    def __init__(self, stack1=None, stack2=None):
        self.stack1 = []
        self.stack2 = []

    def push(self, node):
        # write code here
        self.stack1.append(node)

    def pop(self):
        # return xx
        # 将出栈的stack置空
        while self.stack2:
            self.stack2.pop()
        while self.stack1:
            self.stack2.append(self.stack1.pop())
        res = self.stack2.pop()
        # 成功出栈后将stack2倒回stack1入栈中
        while self.stack2:
            self.stack1.append(self.stack2.pop())
        return res